<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>

<body>
    <header class="aui-bar aui-bar-nav" style="padding-top:25px">
        <a class="aui-pull-left" onclick="api.closeWin();">返回</a>
        <div class="aui-title">消息</div>
    </header>

    <script type="text/javascript">
        apiready = function() {
            var navigationBar = api.require('navigationBar');
            navigationBar.open({
                x: 0,
                y: 70,
                w: api.frameWidth,
                h: 50,
                itemSize: {
                    w: api.frameWidth / 2
                },
                items: [{
                    title: '最新消息',
                    bg: '#ffffff'
                }, {
                    title: '历史消息',
                    bg: '#ffffff'
                }],
                font: {
                    size: 13,
                    sizeSelected: 14,
                    color: '#505050',
                    colorSelected: '#fd5454'
                },
                selectedLine: {
                    color: '#fd5454',
                    width: 2,
                    marginLR: 19
                },
                selectedIndex: 0,
                fixedOn: api.frameName
            }, function(ret, err) {
                if (ret) {
                    api.setFrameGroupIndex({
                        name: 'message_list',
                        index: ret.index
                    });
                } else {
                    alert(JSON.stringify(err));
                }
            });

            api.openFrameGroup({
                name: 'message_list',
                background: '#fff',
                scrollEnabled: true,
                rect: {
                    x: 0,
                    y: 120,
                    w: 'auto',
                    h: 'auto'
                },
                index: 0,
                frames: [{
                    name: 'message_new',
                    url: 'message_new.html',
                    bgColor: '#f8f8f8'
                }, {
                    name: 'message_all',
                    url: 'message_all.html',
                    bgColor: '#f8f8f8'
                }]
            }, function(ret, err) {
                if (ret) {
                    navigationBar.config({
                        key: 'selectedIndex',
                        value: ret.index
                    })
                } else {
                    alert(JSON.stringify(err));
                }
            });

        }
    </script>
</body>

</html>
